-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't stop for errors dumping invalid names or long names #375
Conversation
Made some minor changes so that extraction continues despite errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR !
I think this PR is a bit overkill, only the first remove of throw
seems needed.
//throw std::runtime_error( | ||
std::string("Error writing file to errors dir. ") + (base + ERRORSDIR + url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting the throw std::runtime_error(
will just not throw the "error string".
But the std::string
is still created for nothing.
Better remove the two lines.
//throw std::runtime_error( | ||
std::string("Error creating symlink from ") + full_path + " to " + redirectPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this one.
Here we are failing to create a symlink. It can fails for a lot of reason. And even if we fail about a too long names, we must go through the error handling (and here, potentially print a warning only instead of failing if name is too long).
@@ -395,7 +395,7 @@ int subcmdDump(ZimDumper &app, std::map<std::string, docopt::value> &args) | |||
std::string directory = args["--dir"].asString(); | |||
|
|||
if (directory.empty()) { | |||
throw std::runtime_error("Directory cannot be empty."); | |||
//throw std::runtime_error("Directory cannot be empty."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. This test is used to not overwrite a existing content in the output directory.
We don't want to remove it.
We can not just skip these files. They need somehow to be written on the disk and the trace should be written in the exception log. |
Definitely would appreciate that. Unfortunately I think it is beyond my coding ability to implement. Hopefully this inspires someone to take a look? Thanks! |
Made some minor changes so that extraction continues despite errors from invalid characters and long names.
See issues:
#373
#318
#213
For example: